package org.lucava.boatskeeper.client.event.user;

import org.lucava.boatskeeper.shared.User;

import com.google.gwt.event.shared.GwtEvent;

public class UserUpdatedEvent extends GwtEvent<UserUpdatedEventHandler> {
	public static Type<UserUpdatedEventHandler> TYPE = new Type<UserUpdatedEventHandler>();
	private final User updatedUser;

	public UserUpdatedEvent(User updatedUser) {
		this.updatedUser = updatedUser;
	}

	public User getUpdatedUser() {
		return updatedUser;
	}

	@Override
	public Type<UserUpdatedEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(UserUpdatedEventHandler handler) {
		handler.onUserUpdated(this);
	}
}
